
// 1.导入
import Vue from 'vue';
import VueRouter from 'vue-router';
import Layout from '@/views/Layout';
import Home from '@/views/Home';
import Search from '@/views/Search';
import Wyy from "@/views/Wyy";

// 2.注册路由
Vue.use(VueRouter);

// 3.注册路由规则数组(配置路由表)
let routes = [
    {
        path: '/',
        redirect: '/layout'
    },
    {
        path: '/layout',
        redirect: '/layout/wyy',
        component: Layout,
        children: [
            {
                path: 'home',
                component: Home,
                meta: {
                    title: '首页-歌手分类'
                }
            },
            {
                path: 'search',
                component: Search,
                meta: {
                    title: '搜索'
                }
            },
            {
                path: 'wyy',
                component: Wyy,
                meta: {
                    title: '我的'
                }
            },
        ]
    },
    
];

// 4.创建路由实例
const router = new VueRouter({
    routes
});

export default router



